.class final Ldgb/a;
.super Ljava/lang/Object;
.source "SourceFile"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Ldgb/a$b;,
        Ldgb/a$a;
    }
.end annotation


# static fields
.field private static final d:[Ljava/lang/String;


# instance fields
.field private a:Ldgb/a$b;

.field private b:Landroid/content/Context;

.field private c:Ljava/lang/String;


# direct methods
.method static constructor <clinit>()V
    .locals 3

    const/16 v0, 0xe

    new-array v0, v0, [Ljava/lang/String;

    const/4 v1, 0x0

    const-string v2, "a"

    aput-object v2, v0, v1

    const/4 v1, 0x1

    const-string v2, "b"

    aput-object v2, v0, v1

    const/4 v1, 0x2

    const-string v2, "c"

    aput-object v2, v0, v1

    const/4 v1, 0x3

    const-string v2, "d"

    aput-object v2, v0, v1

    const/4 v1, 0x4

    const-string v2, "e"

    aput-object v2, v0, v1

    const/4 v1, 0x5

    const-string v2, "f"

    aput-object v2, v0, v1

    const/4 v1, 0x6

    const-string v2, "g"

    aput-object v2, v0, v1

    const/4 v1, 0x7

    const-string v2, "h"

    aput-object v2, v0, v1

    const/16 v1, 0x8

    const-string v2, "i"

    aput-object v2, v0, v1

    const/16 v1, 0x9

    const-string v2, "k"

    aput-object v2, v0, v1

    const/16 v1, 0xa

    const-string v2, "l"

    aput-object v2, v0, v1

    const/16 v1, 0xb

    const-string v2, "m"

    aput-object v2, v0, v1

    const/16 v1, 0xc

    const-string v2, "n"

    aput-object v2, v0, v1

    const/16 v1, 0xd

    const-string v2, "o"

    aput-object v2, v0, v1

    .line 1
    sput-object v0, Ldgb/a;->d:[Ljava/lang/String;

    return-void
.end method

.method constructor <init>(Landroid/content/Context;Ljava/lang/String;)V
    .locals 1

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 2
    new-instance v0, Ldgb/a$b;

    invoke-direct {v0, p0, p1, p2}, Ldgb/a$b;-><init>(Ldgb/a;Landroid/content/Context;Ljava/lang/String;)V

    iput-object v0, p0, Ldgb/a;->a:Ldgb/a$b;

    .line 3
    iput-object p1, p0, Ldgb/a;->b:Landroid/content/Context;

    .line 4
    iput-object p2, p0, Ldgb/a;->c:Ljava/lang/String;

    return-void
.end method

.method private a(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Ldgb/a$a;
    .locals 12

    const-string v0, "stat.AppDatabase"

    const/4 v1, 0x0

    .line 58
    :try_start_0
    iget-object v2, p0, Ldgb/a;->a:Ldgb/a$b;

    invoke-virtual {v2}, Landroid/database/sqlite/SQLiteOpenHelper;->getReadableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v2
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_3
    .catchall {:try_start_0 .. :try_end_0} :catchall_1

    .line 59
    :try_start_1
    iget-object v4, p0, Ldgb/a;->c:Ljava/lang/String;

    sget-object v5, Ldgb/a;->d:[Ljava/lang/String;

    const/4 v8, 0x0

    const/4 v9, 0x0

    const-string v10, "a ASC"

    move-object v3, v2

    move-object v6, p1

    move-object v7, p2

    move-object v11, p3

    invoke-virtual/range {v3 .. v11}, Landroid/database/sqlite/SQLiteDatabase;->query(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object p1
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_2
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 60
    :try_start_2
    new-instance p2, Lorg/json/JSONArray;

    invoke-direct {p2}, Lorg/json/JSONArray;-><init>()V

    const-wide/16 v3, 0x0

    const/4 p3, 0x0

    if-eqz p1, :cond_2

    .line 61
    invoke-interface {p1}, Landroid/database/Cursor;->getCount()I

    move-result v5

    if-lez v5, :cond_2

    .line 62
    invoke-interface {p1}, Landroid/database/Cursor;->moveToFirst()Z

    const/4 v3, 0x0

    .line 63
    :cond_0
    invoke-interface {p1, p3}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v4
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_1
    .catchall {:try_start_2 .. :try_end_2} :catchall_2

    .line 64
    :try_start_3
    new-instance v6, Lorg/json/JSONObject;

    invoke-direct {v6}, Lorg/json/JSONObject;-><init>()V

    const-string v7, "b"

    const/4 v8, 0x1

    .line 65
    invoke-interface {p1, v8}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v6, v7, v8}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string v7, "c"

    const/4 v8, 0x2

    .line 66
    invoke-interface {p1, v8}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v6, v7, v8}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string v7, "d"

    const/4 v8, 0x3

    .line 67
    invoke-interface {p1, v8}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v6, v7, v8}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string v7, "e"

    const/4 v8, 0x4

    .line 68
    invoke-interface {p1, v8}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v6, v7, v8}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string v7, "f"

    const/4 v8, 0x5

    .line 69
    invoke-interface {p1, v8}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v6, v7, v8}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string v7, "g"

    const/4 v8, 0x6

    .line 70
    invoke-interface {p1, v8}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v6, v7, v8}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string v7, "h"

    const/4 v8, 0x7

    .line 71
    invoke-interface {p1, v8}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v6, v7, v8}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string v7, "i"

    const/16 v8, 0x8

    .line 72
    invoke-interface {p1, v8}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v6, v7, v8}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string v7, "k"

    const/16 v8, 0x9

    .line 73
    invoke-interface {p1, v8}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v6, v7, v8}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string v7, "l"

    const/16 v8, 0xa

    .line 74
    invoke-interface {p1, v8}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v6, v7, v8}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string v7, "m"

    const/16 v8, 0xb

    .line 75
    invoke-interface {p1, v8}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v6, v7, v8}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string v7, "n"

    const/16 v8, 0xc

    .line 76
    invoke-interface {p1, v8}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v6, v7, v8}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    const-string v7, "o"

    const/16 v8, 0xd

    .line 77
    invoke-interface {p1, v8}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v6, v7, v8}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    .line 78
    invoke-virtual {p2, v6}, Lorg/json/JSONArray;->put(Ljava/lang/Object;)Lorg/json/JSONArray;
    :try_end_3
    .catch Lorg/json/JSONException; {:try_start_3 .. :try_end_3} :catch_0
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_1
    .catchall {:try_start_3 .. :try_end_3} :catchall_2

    add-int/lit8 v3, v3, 0x1

    goto :goto_0

    :catch_0
    move-exception v6

    .line 79
    :try_start_4
    sget-boolean v7, Ldgb/z;->d:Z

    if-eqz v7, :cond_1

    const-string v7, "Failed to creat JSONObject!"

    .line 80
    invoke-static {v0, v7, v6}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    .line 81
    :cond_1
    invoke-direct {p0, v4, v5}, Ldgb/a;->b(J)V

    .line 82
    :goto_0
    invoke-interface {p1}, Landroid/database/Cursor;->moveToNext()Z

    move-result v6

    if-nez v6, :cond_0

    move p3, v3

    move-wide v3, v4

    .line 83
    :cond_2
    sget-boolean v5, Ldgb/z;->c:Z

    if-eqz v5, :cond_3

    .line 84
    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    const-string v6, "There are "

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v5, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string p3, " records are dumped out and the largest row id is "

    invoke-virtual {v5, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v5, v3, v4}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    const-string p3, "."

    invoke-virtual {v5, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p3

    invoke-static {v0, p3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 85
    :cond_3
    new-instance p3, Ldgb/a$a;

    invoke-virtual {p2}, Lorg/json/JSONArray;->toString()Ljava/lang/String;

    move-result-object p2

    invoke-direct {p3, p0, p2, v3, v4}, Ldgb/a$a;-><init>(Ldgb/a;Ljava/lang/String;J)V
    :try_end_4
    .catch Ljava/lang/Exception; {:try_start_4 .. :try_end_4} :catch_1
    .catchall {:try_start_4 .. :try_end_4} :catchall_2

    if-eqz p1, :cond_4

    .line 86
    invoke-interface {p1}, Landroid/database/Cursor;->close()V

    .line 87
    :cond_4
    invoke-static {v2}, Ldgb/a0;->b(Landroid/database/sqlite/SQLiteDatabase;)V

    return-object p3

    :catch_1
    move-exception p2

    goto :goto_1

    :catchall_0
    move-exception p2

    goto :goto_2

    :catch_2
    move-exception p2

    move-object p1, v1

    goto :goto_1

    :catchall_1
    move-exception p2

    move-object v2, v1

    goto :goto_2

    :catch_3
    move-exception p2

    move-object p1, v1

    move-object v2, p1

    .line 88
    :goto_1
    :try_start_5
    sget-boolean p3, Ldgb/z;->d:Z

    if-eqz p3, :cond_5

    const-string p3, "Failed to query the db."

    .line 89
    invoke-static {v0, p3, p2}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    :try_end_5
    .catchall {:try_start_5 .. :try_end_5} :catchall_2

    :cond_5
    if-eqz p1, :cond_6

    .line 90
    invoke-interface {p1}, Landroid/database/Cursor;->close()V

    .line 91
    :cond_6
    invoke-static {v2}, Ldgb/a0;->b(Landroid/database/sqlite/SQLiteDatabase;)V

    return-object v1

    :catchall_2
    move-exception p2

    move-object v1, p1

    :goto_2
    if-eqz v1, :cond_7

    .line 92
    invoke-interface {v1}, Landroid/database/Cursor;->close()V

    .line 93
    :cond_7
    invoke-static {v2}, Ldgb/a0;->b(Landroid/database/sqlite/SQLiteDatabase;)V

    goto :goto_4

    :goto_3
    throw p2

    :goto_4
    goto :goto_3
.end method

.method private a(Ljava/lang/String;[Ljava/lang/String;)V
    .locals 2

    const/4 v0, 0x0

    .line 53
    :try_start_0
    iget-object v1, p0, Ldgb/a;->a:Ldgb/a$b;

    invoke-virtual {v1}, Landroid/database/sqlite/SQLiteOpenHelper;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v0

    .line 54
    iget-object v1, p0, Ldgb/a;->c:Ljava/lang/String;

    invoke-virtual {v0, v1, p1, p2}, Landroid/database/sqlite/SQLiteDatabase;->delete(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)I
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    goto :goto_0

    :catchall_0
    move-exception p1

    goto :goto_1

    :catch_0
    move-exception p1

    .line 55
    :try_start_1
    sget-boolean p2, Ldgb/z;->d:Z

    if-eqz p2, :cond_0

    const-string p2, "stat.AppDatabase"

    const-string v1, "Faild to clear data from db!"

    .line 56
    invoke-static {p2, v1, p1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 57
    :cond_0
    :goto_0
    invoke-static {v0}, Ldgb/a0;->b(Landroid/database/sqlite/SQLiteDatabase;)V

    return-void

    :goto_1
    invoke-static {v0}, Ldgb/a0;->b(Landroid/database/sqlite/SQLiteDatabase;)V

    throw p1
.end method

.method private b(J)V
    .locals 6

    .line 1
    sget-boolean v0, Ldgb/z;->c:Z

    const-string v1, "stat.AppDatabase"

    if-eqz v0, :cond_0

    .line 2
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "The record with rowId = "

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0, p1, p2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    const-string v2, " will be deleted."

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v1, v0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    :cond_0
    const/4 v0, 0x0

    .line 3
    :try_start_0
    iget-object v2, p0, Ldgb/a;->a:Ldgb/a$b;

    invoke-virtual {v2}, Landroid/database/sqlite/SQLiteOpenHelper;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v0

    .line 4
    iget-object v2, p0, Ldgb/a;->c:Ljava/lang/String;

    const-string v3, "a=?"

    const/4 v4, 0x1

    new-array v4, v4, [Ljava/lang/String;

    const/4 v5, 0x0

    .line 5
    invoke-static {p1, p2}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;

    move-result-object p1

    aput-object p1, v4, v5

    .line 6
    invoke-virtual {v0, v2, v3, v4}, Landroid/database/sqlite/SQLiteDatabase;->delete(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)I
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    goto :goto_0

    :catchall_0
    move-exception p1

    goto :goto_1

    :catch_0
    move-exception p1

    .line 7
    :try_start_1
    sget-boolean p2, Ldgb/z;->d:Z

    if-eqz p2, :cond_1

    const-string p2, "Failed to deleteByRowId!"

    .line 8
    invoke-static {v1, p2, p1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 9
    :cond_1
    :goto_0
    invoke-static {v0}, Ldgb/a0;->b(Landroid/database/sqlite/SQLiteDatabase;)V

    return-void

    :goto_1
    invoke-static {v0}, Ldgb/a0;->b(Landroid/database/sqlite/SQLiteDatabase;)V

    throw p1
.end method

.method private c()J
    .locals 14

    const/4 v0, 0x0

    const-wide/16 v1, 0x0

    .line 1
    :try_start_0
    iget-object v3, p0, Ldgb/a;->a:Ldgb/a$b;

    invoke-virtual {v3}, Landroid/database/sqlite/SQLiteOpenHelper;->getReadableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v3
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 2
    :try_start_1
    iget-object v5, p0, Ldgb/a;->c:Ljava/lang/String;

    const/4 v4, 0x1

    new-array v6, v4, [Ljava/lang/String;

    const-string v4, "a"

    const/4 v13, 0x0

    aput-object v4, v6, v13

    const/4 v7, 0x0

    const/4 v8, 0x0

    const/4 v9, 0x0

    const/4 v10, 0x0

    const-string v11, "a ASC"

    const-string v12, "1"

    move-object v4, v3

    invoke-virtual/range {v4 .. v12}, Landroid/database/sqlite/SQLiteDatabase;->query(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v0

    if-eqz v0, :cond_0

    .line 3
    invoke-interface {v0}, Landroid/database/Cursor;->getCount()I

    move-result v4

    if-lez v4, :cond_0

    .line 4
    invoke-interface {v0}, Landroid/database/Cursor;->moveToFirst()Z

    .line 5
    invoke-interface {v0, v13}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v1
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_1

    :cond_0
    if-eqz v0, :cond_2

    goto :goto_1

    :catch_0
    move-exception v4

    goto :goto_0

    :catchall_0
    move-exception v1

    move-object v3, v0

    goto :goto_2

    :catch_1
    move-exception v4

    move-object v3, v0

    .line 6
    :goto_0
    :try_start_2
    sget-boolean v5, Ldgb/z;->d:Z

    if-eqz v5, :cond_1

    const-string v5, "stat.AppDatabase"

    const-string v6, "Failed to query the db."

    .line 7
    invoke-static {v5, v6, v4}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_1

    :cond_1
    if-eqz v0, :cond_2

    .line 8
    :goto_1
    invoke-interface {v0}, Landroid/database/Cursor;->close()V

    .line 9
    :cond_2
    invoke-static {v3}, Ldgb/a0;->b(Landroid/database/sqlite/SQLiteDatabase;)V

    return-wide v1

    :catchall_1
    move-exception v1

    :goto_2
    if-eqz v0, :cond_3

    .line 10
    invoke-interface {v0}, Landroid/database/Cursor;->close()V

    .line 11
    :cond_3
    invoke-static {v3}, Ldgb/a0;->b(Landroid/database/sqlite/SQLiteDatabase;)V

    throw v1
.end method


# virtual methods
.method public a()I
    .locals 4

    const/4 v0, 0x0

    .line 37
    :try_start_0
    iget-object v1, p0, Ldgb/a;->a:Ldgb/a$b;

    invoke-virtual {v1}, Landroid/database/sqlite/SQLiteOpenHelper;->getReadableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v0

    .line 38
    invoke-static {v0}, Ldgb/a0;->a(Landroid/database/sqlite/SQLiteDatabase;)I

    move-result v1
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 39
    invoke-static {v0}, Ldgb/a0;->b(Landroid/database/sqlite/SQLiteDatabase;)V

    return v1

    :catchall_0
    move-exception v1

    goto :goto_0

    :catch_0
    move-exception v1

    .line 40
    :try_start_1
    sget-boolean v2, Ldgb/z;->d:Z

    if-eqz v2, :cond_0

    const-string v2, "stat.AppDatabase"

    const-string v3, "Failed to get the Size of DB"

    .line 41
    invoke-static {v2, v3, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 42
    :cond_0
    invoke-static {v0}, Ldgb/a0;->b(Landroid/database/sqlite/SQLiteDatabase;)V

    const/4 v0, 0x0

    return v0

    :goto_0
    invoke-static {v0}, Ldgb/a0;->b(Landroid/database/sqlite/SQLiteDatabase;)V

    throw v1
.end method

.method public a(I)V
    .locals 5

    const/4 v0, 0x0

    .line 43
    :try_start_0
    iget-object v1, p0, Ldgb/a;->a:Ldgb/a$b;

    invoke-virtual {v1}, Landroid/database/sqlite/SQLiteOpenHelper;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v0

    .line 44
    iget-object v1, p0, Ldgb/a;->c:Ljava/lang/String;

    const-string v2, "j=?"

    const/4 v3, 0x1

    new-array v3, v3, [Ljava/lang/String;

    const/4 v4, 0x0

    .line 45
    invoke-static {p1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object p1

    aput-object p1, v3, v4

    .line 46
    invoke-virtual {v0, v1, v2, v3}, Landroid/database/sqlite/SQLiteDatabase;->delete(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)I
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    goto :goto_0

    :catchall_0
    move-exception p1

    goto :goto_1

    :catch_0
    move-exception p1

    .line 47
    :try_start_1
    sget-boolean v1, Ldgb/z;->d:Z

    if-eqz v1, :cond_0

    const-string v1, "stat.AppDatabase"

    const-string v2, "DeleteByPublicKeyVersion has Exception!"

    .line 48
    invoke-static {v1, v2, p1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 49
    :cond_0
    :goto_0
    invoke-static {v0}, Ldgb/a0;->b(Landroid/database/sqlite/SQLiteDatabase;)V

    return-void

    :goto_1
    invoke-static {v0}, Ldgb/a0;->b(Landroid/database/sqlite/SQLiteDatabase;)V

    throw p1
.end method

.method public a(J)V
    .locals 3

    const-wide/16 v0, 0x0

    cmp-long v2, p1, v0

    if-gtz v2, :cond_0

    const/4 p1, 0x0

    .line 50
    invoke-direct {p0, p1, p1}, Ldgb/a;->a(Ljava/lang/String;[Ljava/lang/String;)V

    goto :goto_0

    :cond_0
    const/4 v0, 0x1

    new-array v0, v0, [Ljava/lang/String;

    const/4 v1, 0x0

    .line 51
    invoke-static {p1, p2}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;

    move-result-object p1

    aput-object p1, v0, v1

    const-string p1, "a<=?"

    .line 52
    invoke-direct {p0, p1, v0}, Ldgb/a;->a(Ljava/lang/String;[Ljava/lang/String;)V

    :goto_0
    return-void
.end method

.method public a(Ldgb/i;)Z
    .locals 9

    const-string v0, "stat.AppDatabase"

    const/4 v1, 0x0

    const/4 v2, 0x0

    .line 1
    :try_start_0
    iget-object v3, p0, Ldgb/a;->a:Ldgb/a$b;

    invoke-virtual {v3}, Landroid/database/sqlite/SQLiteOpenHelper;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v3
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1
    .catchall {:try_start_0 .. :try_end_0} :catchall_1

    .line 2
    :try_start_1
    invoke-static {v3}, Ldgb/a0;->a(Landroid/database/sqlite/SQLiteDatabase;)I

    move-result v4

    .line 3
    iget-object v5, p0, Ldgb/a;->b:Landroid/content/Context;

    invoke-static {v5}, Ldgb/l;->b(Landroid/content/Context;)J

    move-result-wide v5

    .line 4
    sget-boolean v7, Ldgb/z;->c:Z

    if-eqz v7, :cond_0

    .line 5
    new-instance v7, Ljava/lang/StringBuilder;

    invoke-direct {v7}, Ljava/lang/StringBuilder;-><init>()V

    const-string v8, "Current db file is "

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v3}, Landroid/database/sqlite/SQLiteDatabase;->getPath()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v8, " and its size is "

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v7, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v8, " and its max size is "

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v7, v5, v6}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    const-string v8, "."

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v7

    invoke-static {v0, v7}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    :cond_0
    int-to-long v7, v4

    cmp-long v4, v7, v5

    if-lez v4, :cond_1

    .line 6
    invoke-direct {p0}, Ldgb/a;->c()J

    move-result-wide v4

    .line 7
    invoke-direct {p0, v4, v5}, Ldgb/a;->b(J)V

    .line 8
    :cond_1
    new-instance v4, Landroid/content/ContentValues;

    invoke-direct {v4}, Landroid/content/ContentValues;-><init>()V

    .line 9
    invoke-virtual {p1}, Ldgb/i;->o()Ljava/lang/String;

    move-result-object v5

    const-string v6, "b"

    .line 10
    invoke-virtual {p1}, Ldgb/i;->m()Ljava/lang/String;

    move-result-object v7

    .line 11
    invoke-static {v7, v5}, Ldgb/j;->b(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v4, v6, v7}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    const-string v6, "c"

    .line 12
    invoke-virtual {p1}, Ldgb/c;->a()Ljava/lang/String;

    move-result-object v7

    .line 13
    invoke-static {v7, v5}, Ldgb/j;->b(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v4, v6, v7}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    const-string v6, "d"

    .line 14
    invoke-virtual {p1}, Ldgb/c;->b()Ljava/lang/String;

    move-result-object v7

    .line 15
    invoke-static {v7, v5}, Ldgb/j;->b(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v4, v6, v7}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    const-string v6, "e"

    .line 16
    invoke-virtual {p1}, Ldgb/c;->c()Ljava/lang/String;

    move-result-object v7

    .line 17
    invoke-static {v7, v5}, Ldgb/j;->b(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v4, v6, v7}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    const-string v6, "f"

    .line 18
    invoke-virtual {p1}, Ldgb/c;->g()Ljava/lang/String;

    move-result-object v7

    .line 19
    invoke-static {v7, v5}, Ldgb/j;->b(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v4, v6, v7}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    const-string v6, "g"

    .line 20
    invoke-virtual {p1}, Ldgb/c;->e()Ljava/lang/String;

    move-result-object v7

    .line 21
    invoke-static {v7, v5}, Ldgb/j;->b(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v4, v6, v7}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    const-string v6, "h"

    .line 22
    invoke-virtual {p1}, Ldgb/c;->f()Ljava/lang/String;

    move-result-object v7

    .line 23
    invoke-static {v7, v5}, Ldgb/j;->b(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v4, v6, v7}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    const-string v6, "i"

    .line 24
    invoke-virtual {p1}, Ldgb/i;->l()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v4, v6, v7}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    const-string v6, "j"

    .line 25
    invoke-virtual {p1}, Ldgb/i;->n()I

    move-result v7

    invoke-static {v7}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v7

    invoke-virtual {v4, v6, v7}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    const-string v6, "k"

    .line 26
    invoke-virtual {p1}, Ldgb/c;->h()Ljava/lang/String;

    move-result-object v7

    .line 27
    invoke-static {v7, v5}, Ldgb/j;->b(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v4, v6, v7}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    const-string v6, "l"

    .line 28
    invoke-virtual {p1}, Ldgb/c;->d()Ljava/lang/String;

    move-result-object v7

    invoke-static {v7, v5}, Ldgb/j;->b(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v4, v6, v7}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    const-string v6, "m"

    .line 29
    invoke-virtual {p1}, Ldgb/c;->i()Ljava/lang/String;

    move-result-object v7

    invoke-static {v7, v5}, Ldgb/j;->b(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v4, v6, v7}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    const-string v6, "n"

    .line 30
    invoke-virtual {p1}, Ldgb/c;->j()Ljava/lang/String;

    move-result-object v7

    invoke-static {v7, v5}, Ldgb/j;->b(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v4, v6, v7}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    const-string v6, "o"

    .line 31
    invoke-virtual {p1}, Ldgb/c;->k()Ljava/lang/String;

    move-result-object p1

    invoke-static {p1, v5}, Ldgb/j;->b(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object p1

    invoke-virtual {v4, v6, p1}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 32
    iget-object p1, p0, Ldgb/a;->c:Ljava/lang/String;

    invoke-virtual {v3, p1, v2, v4}, Landroid/database/sqlite/SQLiteDatabase;->insert(Ljava/lang/String;Ljava/lang/String;Landroid/content/ContentValues;)J

    move-result-wide v4
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    const-wide/16 v6, 0x0

    cmp-long p1, v4, v6

    if-ltz p1, :cond_2

    const/4 v1, 0x1

    .line 33
    :cond_2
    invoke-static {v3}, Ldgb/a0;->b(Landroid/database/sqlite/SQLiteDatabase;)V

    return v1

    :catchall_0
    move-exception p1

    move-object v2, v3

    goto :goto_1

    :catch_0
    move-exception p1

    move-object v2, v3

    goto :goto_0

    :catchall_1
    move-exception p1

    goto :goto_1

    :catch_1
    move-exception p1

    .line 34
    :goto_0
    :try_start_2
    sget-boolean v3, Ldgb/z;->d:Z

    if-eqz v3, :cond_3

    const-string v3, "Failed to push to DB!"

    .line 35
    invoke-static {v0, v3, p1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_1

    .line 36
    :cond_3
    invoke-static {v2}, Ldgb/a0;->b(Landroid/database/sqlite/SQLiteDatabase;)V

    return v1

    :goto_1
    invoke-static {v2}, Ldgb/a0;->b(Landroid/database/sqlite/SQLiteDatabase;)V

    throw p1
.end method

.method public b(I)Ldgb/a$a;
    .locals 1

    const/4 v0, 0x0

    if-gtz p1, :cond_0

    move-object p1, v0

    goto :goto_0

    .line 10
    :cond_0
    invoke-static {p1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object p1

    :goto_0
    invoke-direct {p0, v0, v0, p1}, Ldgb/a;->a(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Ldgb/a$a;

    move-result-object p1

    return-object p1
.end method

.method public b()Z
    .locals 13

    const/4 v0, 0x0

    const/4 v1, 0x1

    .line 11
    :try_start_0
    iget-object v2, p0, Ldgb/a;->a:Ldgb/a$b;

    invoke-virtual {v2}, Landroid/database/sqlite/SQLiteOpenHelper;->getReadableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v2
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1
    .catchall {:try_start_0 .. :try_end_0} :catchall_1

    .line 12
    :try_start_1
    iget-object v4, p0, Ldgb/a;->c:Ljava/lang/String;

    const/4 v5, 0x0

    const/4 v6, 0x0

    const/4 v7, 0x0

    const/4 v8, 0x0

    const/4 v9, 0x0

    const/4 v10, 0x0

    const-string v11, "1"

    move-object v3, v2

    invoke-virtual/range {v3 .. v11}, Landroid/database/sqlite/SQLiteDatabase;->query(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v0

    if-eqz v0, :cond_2

    .line 13
    invoke-interface {v0}, Landroid/database/Cursor;->getCount()I

    move-result v3
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    if-nez v3, :cond_0

    goto :goto_0

    :cond_0
    const/4 v1, 0x0

    :goto_0
    if-eqz v0, :cond_1

    .line 14
    invoke-interface {v0}, Landroid/database/Cursor;->close()V

    .line 15
    :cond_1
    invoke-static {v2}, Ldgb/a0;->b(Landroid/database/sqlite/SQLiteDatabase;)V

    return v1

    :cond_2
    if-eqz v0, :cond_3

    .line 16
    invoke-interface {v0}, Landroid/database/Cursor;->close()V

    .line 17
    :cond_3
    invoke-static {v2}, Ldgb/a0;->b(Landroid/database/sqlite/SQLiteDatabase;)V

    return v1

    :catchall_0
    move-exception v1

    goto :goto_2

    :catch_0
    move-exception v3

    move-object v12, v2

    move-object v2, v0

    move-object v0, v12

    goto :goto_1

    :catchall_1
    move-exception v1

    move-object v2, v0

    goto :goto_2

    :catch_1
    move-exception v3

    move-object v2, v0

    .line 18
    :goto_1
    :try_start_2
    sget-boolean v4, Ldgb/z;->d:Z

    if-eqz v4, :cond_4

    const-string v4, "stat.AppDatabase"

    const-string v5, "Failed to judge db empty!"

    .line 19
    invoke-static {v4, v5, v3}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_2

    :cond_4
    if-eqz v2, :cond_5

    .line 20
    invoke-interface {v2}, Landroid/database/Cursor;->close()V

    .line 21
    :cond_5
    invoke-static {v0}, Ldgb/a0;->b(Landroid/database/sqlite/SQLiteDatabase;)V

    return v1

    :catchall_2
    move-exception v1

    move-object v12, v2

    move-object v2, v0

    move-object v0, v12

    :goto_2
    if-eqz v0, :cond_6

    .line 22
    invoke-interface {v0}, Landroid/database/Cursor;->close()V

    .line 23
    :cond_6
    invoke-static {v2}, Ldgb/a0;->b(Landroid/database/sqlite/SQLiteDatabase;)V

    throw v1
.end method
